package main

import "fmt"

func TwoSum(a [5]int, target int) {
  for i := 0; i < len(a); i++ {
    other := target - a[i]
    for j := i + 1; j < len(a); j++ {
      if a[j] == other {
        fmt.Printf("(%d,%d)\n", i, j)
      }
    }
  }
}

func testTwoSum() {
  b := [...]int{1, 3, 5, 8, 7}
  TwoSum(b, 8)
}

func main() {
  testTwoSum()
/*
   (0,4)
   (1,2)
*/
}
